<!DOCTYPE html>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<head>
    <title>Love~L</title>

</head>
<body>
<canvas id="canvas"></canvas>
<div id="app"><h4>💗致亲爱的粘小孩</h4></div><!--这里写名字❤！！！-->

<script src="./sakura.js"></script>
<style type="text/css">
    body {
        margin: 0;
        padding: 0;
        overflow: hidden;
    }
</style>
<script type="text/javascript">
    var canvas = document.getElementById('canvas');
    var ctx = canvas.getContext('2d');


    canvas.height = window.innerHeight;
    canvas.width = window.innerWidth;

    var texts = 'I LOVE U'.split('');

    var fontSize = 16;
    var columns = canvas.width / fontSize;
    // 用于计算输出文字时坐标，所以长度即为列数
    var drops = [];
    //初始值
    for (var x = 0; x < columns; x++) {
        drops[x] = 1;
    }

    function draw() {
        //让背景逐渐由透明到不透明
        ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';
        ctx.fillRect(0, 0, canvas.width, canvas.height);
        //文字颜色
        ctx.fillStyle = '#f584b7';
        ctx.font = fontSize + 'px arial';
        //逐行输出文字
        for (var i = 0; i < drops.length; i++) {
            var text = texts[Math.floor(Math.random() * texts.length)];
            ctx.fillText(text, i * fontSize, drops[i] * fontSize);

            if (drops[i] * fontSize > canvas.height || Math.random() > 0.95) {
                drops[i] = 0;
            }

            drops[i]++;
        }
    }

    setInterval(draw, 33);
</script>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
    <TITLE> love</TITLE>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    <meta charset="UTF-8">
    <style>
        html, body {
            height: 100%;
            padding: 0;
            margin: 0;
            background: rgb(0, 0, 0,0);
        }

        canvas {
            position: absolute;
            width: 100%;
            height: 100%;
        }

        #app {
            position: absolute;
            width: 100%;
            height: 100%;


        }

        h4 {
            font-family: "STKaiti";
            font-size: 40px;
            color: #f584b7;
            position: relative;
        }
    </style>
</head>
<body>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <link rel="stylesheet" href="./css/shubiao.css" type="text/css">
</head>
<body>
<div style="width: 100%; height: 1000px; background-color: #000000;"></div>
<script src="js/shubiao.js"></script>
</body>
</html>

